home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //==================================================================
- //
- // Set up the global arrays that contain the image format extensions.
- // This has to be separated from the Menu building
- // code, because other areas of Maya need to access these arrays and if
- // this is tied into the building of the menus, they can't do this.
- //
- // NOTE !!!! WARNING !!!!
- // If you make a change to the code in this procedure, you also need
- // to make the corresponding change in the 'createImageFile' procedure
- // of renderGlobalsWindow.mel.
- //
- // This code is also called from dynPaintMenus.mel since it may
- // be required for PFX canvas saving.
- //
- //==================================================================
- global proc createImageFormats( )
- {
- global string $imgExt[18]; // This is the actual file extension
- global int $imgExtNum[18]; // This is the corresponding internal value
-
- if (`about -nt`) {
- $imgExt[0] = "als"; $imgExtNum[0] = 6;
- $imgExt[1] = "avi"; $imgExtNum[1] = 23;
- $imgExt[2] = "cin"; $imgExtNum[2] = 11;
- $imgExt[3] = "eps"; $imgExtNum[3] = 9;
- $imgExt[4] = "gif"; $imgExtNum[4] = 0;
- $imgExt[5] = "jpeg"; $imgExtNum[5] = 8;
- $imgExt[6] = "iff"; $imgExtNum[6] = 7;
- $imgExt[7] = "iff"; $imgExtNum[7] = 10;
- $imgExt[8] = "yuv"; $imgExtNum[8] = 12;
- $imgExt[9] = "rla"; $imgExtNum[9] = 2;
- $imgExt[10] = "sgi"; $imgExtNum[10] = 5;
- $imgExt[11] = "sgi"; $imgExtNum[11] = 13;
- $imgExt[12] = "pic"; $imgExtNum[12] = 1;
- $imgExt[13] = "tga"; $imgExtNum[13] = 19;
- $imgExt[14] = "tif"; $imgExtNum[14] = 3;
- $imgExt[15] = "tif"; $imgExtNum[15] = 4;
- $imgExt[16] = "bmp"; $imgExtNum[16] = 20;
- } else if (`about -irix`) {
- $imgExt[0] = "als"; $imgExtNum[0] = 6;
- $imgExt[1] = "avi"; $imgExtNum[1] = 23;
- $imgExt[2] = "cin"; $imgExtNum[2] = 11;
- $imgExt[3] = "eps"; $imgExtNum[3] = 9;
- $imgExt[4] = "gif"; $imgExtNum[4] = 0;
- $imgExt[5] = "jpeg"; $imgExtNum[5] = 8;
- $imgExt[6] = "iff"; $imgExtNum[6] = 7;
- $imgExt[7] = "iff"; $imgExtNum[7] = 10;
- $imgExt[8] = "yuv"; $imgExtNum[8] = 12;
- $imgExt[9] = "qt"; $imgExtNum[9] = 22;
- $imgExt[10] = "rla"; $imgExtNum[10] = 2;
- $imgExt[11] = "sgi"; $imgExtNum[11] = 5;
- $imgExt[12] = "sgi"; $imgExtNum[12] = 13;
- $imgExt[13] = "mv"; $imgExtNum[13] = 21;
- $imgExt[14] = "pic"; $imgExtNum[14] = 1;
- $imgExt[15] = "tga"; $imgExtNum[15] = 19;
- $imgExt[16] = "tif"; $imgExtNum[16] = 3;
- $imgExt[17] = "tif"; $imgExtNum[17] = 4;
- $imgExt[18] = "bmp"; $imgExtNum[18] = 20;
- } else if (`about -linux`) {
- $imgExt[0] = "als"; $imgExtNum[0] = 6;
- $imgExt[1] = "cin"; $imgExtNum[1] = 11;
- $imgExt[2] = "eps"; $imgExtNum[2] = 9;
- $imgExt[3] = "gif"; $imgExtNum[3] = 0;
- $imgExt[4] = "jpeg"; $imgExtNum[4] = 8;
- $imgExt[5] = "iff"; $imgExtNum[5] = 7;
- $imgExt[6] = "iff"; $imgExtNum[6] = 10;
- $imgExt[7] = "yuv"; $imgExtNum[7] = 12;
- $imgExt[8] = "rla"; $imgExtNum[8] = 2;
- $imgExt[9] = "sgi"; $imgExtNum[9] = 5;
- $imgExt[10] = "sgi"; $imgExtNum[10] = 13;
- $imgExt[11] = "pic"; $imgExtNum[11] = 1;
- $imgExt[12] = "tga"; $imgExtNum[12] = 19;
- $imgExt[13] = "tif"; $imgExtNum[13] = 3;
- $imgExt[14] = "tif"; $imgExtNum[14] = 4;
- $imgExt[15] = "bmp"; $imgExtNum[15] = 20;
- } else if (`about -mac`) {
- $imgExt[0] = "jpeg"; $imgExtNum[0] = 8;
- $imgExt[1] = "iff"; $imgExtNum[1] = 7;
- $imgExt[2] = "iff"; $imgExtNum[2] = 10;
- $imgExt[3] = "pntg"; $imgExtNum[3] = 30;
- $imgExt[4] = "ps"; $imgExtNum[4] = 31;
- $imgExt[5] = "png"; $imgExtNum[5] = 32;
- $imgExt[6] = "pict"; $imgExtNum[6] = 33;
- $imgExt[7] = "qt"; $imgExtNum[7] = 22;
- $imgExt[8] = "qtif"; $imgExtNum[8] = 34;
- $imgExt[9] = "sgi"; $imgExtNum[9] = 5;
- $imgExt[10] = "tga"; $imgExtNum[10] = 19;
- $imgExt[11] = "tif"; $imgExtNum[11] = 3;
- $imgExt[12] = "bmp"; $imgExtNum[12] = 20;
- } else {
- warning "Unsupported platform in createImageFormats.mel";
- }
- }
-
- global proc string extOfImageFormat(int $imageFormatNum)
- {
- //
- // Description:
- // Given an image format number as would be found in
- // defaultRenderGlobals.imageFormat, this procedure returns the string
- // extension corresponding to that image format.
- // If the image format is not supported on the current platform, the
- // return value is the empty string.
- //
-
- string $imageFormat = "";
- int $i;
- global string $imgExt[];
- global int $imgExtNum[];
-
- for ($i = 0; $i < size($imgExt); $i++)
- {
- if ($imgExtNum[$i] == $imageFormatNum)
- {
- $imageFormat = $imgExt[$i];
- break;
- }
- }
-
- return $imageFormat;
- }
-